f = open('data.txt', 'w', encoding='utf-8')
for i in range(1, 101):
    # print(i)
    f.write(str(i) + '\n')  # 字符串数据
    # f.write(f'{i}\n')

f.close()  # 记得要写
